<template>
  <el-table-column :prop="item.prop" :label="item.label" :width="item.width" :align="item.align">
    <template #default="{ row }">
      <el-tag style="margin-right: 8px" v-for="(tag, i) in row[item.prop]" :key="i">{{ tag }}</el-tag>
    </template>
  </el-table-column>
</template>

<script setup lang="ts">
  import { PropType, toRefs } from 'vue';

  import { TagsColumnType } from '../common-table-type';

  const props = defineProps({
    item: {
      type: Object as PropType<TagsColumnType>,
      default: () => ({}),
    },
  });

  const { item } = toRefs(props);
</script>

<style scoped></style>
